<?php

class EmailController extends Controller
{
	public function actionRestrictIpReset()
	{
		$id_user = app()->request->getParam('id_user', null);
		$ret = false;
		if($id_user){
			app()->mail->sendResetRestrictIps($id_user);
		}
		
		$this->_returnAjax(array(
			'result' => $ret
		));
	}
	
	public function accessRules()
	{
		return array(
			array(
				'allow',
				'actions' => array('restrictipreset'),
				'expression' => 'app()->user->anyone()'
			),

			array(
				'deny',	//should be 'deny', 'allow' is used to give convenient to make test
				'users' => array('*'),
				'redirect' => array('user/login')
			)
		);
	}
	

}